<script type="text/javascript">
wxpay = {p:{},f:{}};
wxpay.p.loaded = false;
wxpay.p.action = '/wechat/WxPay/pay?token=true&serial=<?php echo $serial?>&id=<?php echo $id?>';
go_to_pay_ = function(){
	$.mobile.loading( "show");
	if(wxpay.p.loaded)return;
	  var data = {};
		var callback = function(res){
			$('#ajax_go_to_pay_').html(res.html);
			ajax_go_to_pay_();
			$('.ui-loader').loader( "hide");
		};
		$.ajax({
			  type: "get",
			  url: wxpay.p.action,
			  dataType:'json',
			}).done(function( msg ) {
				callback(msg);
			});
}
</script>
<div id = 'ajax_go_to_pay_' style = 'display:none;'></div>
